package com.hison.courseselectionsystem.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 
 * @TableName course
 */
@TableName(value ="course")
@Data
@ApiModel(value = "课程表",description = "课程信息表")
public class Course implements Serializable {
    /**
     * 课程id，自增
     */
    @TableId
    @ApiModelProperty(value = "主键")
    private Integer id;

    /**
     * 课程名称
     */
    @ApiModelProperty("课程名称")
    private String name;

    /**
     * 课程绩点
     */
    @ApiModelProperty("课程绩点")
    private Integer credit;

    /**
     * 课程类型  0选修课   1必修课
     */
    @ApiModelProperty("课程类型")
    private Integer courseType;

    /**
     * 课程考核方式
     */
    @ApiModelProperty("课程考核方式")
    private String evaluattionMethod;

    /**
     * 上课时间
     */
    @ApiModelProperty("上课时间")
    private Date classTime;

    /**
     * 上课地点
     */
    @ApiModelProperty("上课地点")
    private String classRoom;

    /**
     * 课程成绩
     */
    @ApiModelProperty("课程成绩")
    private Double score;

    /**
     * 课程描述
     */
    @ApiModelProperty("课程描述")
    private String description;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Course other = (Course) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getCredit() == null ? other.getCredit() == null : this.getCredit().equals(other.getCredit()))
            && (this.getCourseType() == null ? other.getCourseType() == null : this.getCourseType().equals(other.getCourseType()))
            && (this.getEvaluattionMethod() == null ? other.getEvaluattionMethod() == null : this.getEvaluattionMethod().equals(other.getEvaluattionMethod()))
            && (this.getClassTime() == null ? other.getClassTime() == null : this.getClassTime().equals(other.getClassTime()))
            && (this.getClassRoom() == null ? other.getClassRoom() == null : this.getClassRoom().equals(other.getClassRoom()))
            && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getCredit() == null) ? 0 : getCredit().hashCode());
        result = prime * result + ((getCourseType() == null) ? 0 : getCourseType().hashCode());
        result = prime * result + ((getEvaluattionMethod() == null) ? 0 : getEvaluattionMethod().hashCode());
        result = prime * result + ((getClassTime() == null) ? 0 : getClassTime().hashCode());
        result = prime * result + ((getClassRoom() == null) ? 0 : getClassRoom().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", credit=").append(credit);
        sb.append(", courseType=").append(courseType);
        sb.append(", evaluattionMethod=").append(evaluattionMethod);
        sb.append(", classTime=").append(classTime);
        sb.append(", classRoom=").append(classRoom);
        sb.append(", score=").append(score);
        sb.append(", description=").append(description);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}